package com.mmy.dao.group;

import javax.transaction.Transactional;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.mmy.domain.group.TGroupScenery;

/**
 * @vesion 
 * @description 
 * @author liys
 * @date 2021-5-24
 */
public interface TGroupSceneryRepository extends JpaRepository<TGroupScenery, Integer>{
	
	/**
	  * @descr 
	  * @param 
	  * @return 
	  * @throws 
	  * @author liys
	  * @date 2021-6-1
	 */
	@Query(value = "select MAX(iSceneryID) from tGroupScenery ", nativeQuery = true)
	Object getMaxID();
	
	/**
	  * @descr 创建只含id的对象 
	  * @param 
	  * @return 
	  * @throws 
	  * @author liys
	  * @date 2021-6-9
	 */
	@Transactional
	@Modifying
	@Query(value = "INSERT INTO tGroupScenery(iSceneryID, bType, cCreator, cMemo, cReviser, cSpare3, cSpare4, cSpare5, dCreateDate, dModifyDate, fSpare2, fTotal, iCreatorID, iKeyID, iNum, iPlanID, iReviserID, iSpare1) VALUES"
			+ " (:id, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0)", nativeQuery = true)
	void insert(@Param("id")int id);
}
